package link.chengguo.orangemall.modules.user.rest;

import link.chengguo.orangemall.api.ApiResult;
import link.chengguo.orangemall.common.interceptor.AuthCheck;
import link.chengguo.orangemall.modules.user.domain.AuthConfig;
import link.chengguo.orangemall.modules.user.service.AuthConfigService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 钟业海
 * @Date: 2020/7/28 11:48
 */
@Slf4j
@RestController
@Api(value = "用户认证配置", tags = "用户认证:用户认证配置", description = "用户认证配置")
public class AuthConfigController {

    @Autowired
    private AuthConfigService authConfigService;

    /**
     * 获取配置
     */
    @AuthCheck
    @GetMapping("/getAuthConfig")
    @ApiOperation(value = "获取用户信息",notes = "获取用户信息",response = AuthConfig.class)
    public ApiResult<Object> getConfig(){
        return ApiResult.ok(authConfigService.getOne(new QueryWrapper<>()));
    }

}
